<template>
	<view :style="{height:PhoneInfo.windowHeight + 'px',width:PhoneInfo.windowWidth + 'px'}">
		<!-- 消息提示 -->
		<u-toast ref="uToast"></u-toast>
		<view class="more">
			<u-icon name="search" label="更多" size="28" @click="showmore=true"></u-icon>
		</view>
		<cover-view v-show="showmore" @click="moreconfirm" class="shabe">
			<!-- 指标列表 -->
			<cover-view class="zhibiaoliebiao" v-if="indexlistshow==true" @click.stop="indexlistshow=true">
				<cover-view style="margin-top: 1%;">
					<cover-view class="biaoti">结构噪声</cover-view>
					<cover-view class="xiaindexlist">
						<cover-view :class="['indexlistview',constructionitem.show==true?'xz':'wxz']"
							v-for="(constructionitem, index) in characteristic.construction"
							:key="constructionitem.code"
							@click.stop="alterindex(constructionitem)">{{constructionitem.name}}
						</cover-view>
					</cover-view>
				</cover-view>
				<cover-view v-if="characteristic.air.length!==0">
					<cover-view class="biaoti">空气噪声</cover-view>
					<cover-view class="xiaindexlist">
						<cover-view :class="['indexlistview',airitem.show==true?'xz':'wxz']"
							v-for="(airitem, index) in characteristic.air" :key="airitem.code"
							@click.stop="alterindex(airitem)">{{airitem.name}}
						</cover-view>
					</cover-view>
				</cover-view>
				<cover-view>
					<cover-view class="biaoti">振动烈度</cover-view>
					<cover-view class="xiaindexlist">
						<cover-view :class="['indexlistview',vibrationitem.show==true?'xz':'wxz']"
							v-for="(vibrationitem, index) in characteristic.vibration" :key="vibrationitem.code"
							@click.stop="alterindex(vibrationitem)">{{vibrationitem.name}}
						</cover-view>
					</cover-view>
				</cover-view>
				<cover-view v-if="characteristic.basics.length!==0">
					<cover-view class="biaoti">基础信息</cover-view>
					<cover-view class="xiaindexlist">
						<cover-view :class="['indexlistview',basicsitem.show==true?'xz':'wxz']"
							v-for="(basicsitem, index) in characteristic.basics" :key="basicsitem.code"
							@click.stop="alterindex(basicsitem)">{{basicsitem.name}}
						</cover-view>
					</cover-view>
				</cover-view>
			</cover-view>
			<cover-view class="shabedata" @click.stop="showmore=true;indexlistshow=false">
				<cover-view class="zdytime">
					<cover-view class="title">时间</cover-view>
					<cover-view @click.stop="selectiontime(0)" class="time"
						style="margin-left: 5%;">{{this.$utils.getTime(Number(this.startTimeValue),1)}}</cover-view>
					<cover-view class="hgtime">至</cover-view>
					<cover-view @click.stop="selectiontime(1)"
						class="time">{{this.$utils.getTime(Number(this.endTimeValue),1)}}</cover-view>
				</cover-view>
				<cover-view class="kjtime">
					<cover-view :class="['timeview',item.show==true?'xz':'wxz']" v-for="(item, index) in columns"
						:key="item.id" @click.stop="altertime(item)">{{item.name}}
					</cover-view>
				</cover-view>
				<!-- 指标 -->
				<cover-view class="zhibiao">
					<cover-view class="title">指标</cover-view>
					<cover-view class="indexyxz" v-for="(item, index) in indexlist" :key="item.id"
						@click.stop="indexlistshow=true">{{item.name}}
					</cover-view>
				</cover-view>
				<cover-view :class="waveformnumber==false?'waveform':'wavef'" @click.stop="clickwaveform">
					只看波形数据
				</cover-view>
				<cover-view class="alterduibi" v-show="indexlist.length==1?true:false">
					<cover-view class="title">操作</cover-view>
					<cover-view class="viewcover" @click.stop="gotofeaturelist">修改阈值</cover-view>
					<cover-view class="viewcover" @click.stop="clickcompare">指标对比</cover-view>
				</cover-view>
			</cover-view>
		</cover-view>
		<!-- 开始时间 -->
		<u-datetime-picker ref="datetimePicker" title="开始时间" :maxDate='new Date().getTime()'
			:minDate='new Date().getTime()-15552000000' :show="showStartTime" v-model="this.startTimeValue" mode="date"
			@confirm='startconfirm' @cancel='showStartTime=false;canvasshow=true;showmore=true'>
		</u-datetime-picker>
		<!-- 结束时间 -->
		<u-datetime-picker ref="datetimePicker" title="结束时间" :maxDate='new Date().getTime()'
			:minDate='new Date().getTime()-15552000000' :show="showEndTime" v-model="this.endTimeValue" mode="date"
			@confirm='endconfirm' @cancel='showEndTime=false;canvasshow=true;showmore=true'>
		</u-datetime-picker>
		<!-- 波形选择器 -->
		<u-picker :show="waveshow" :title='tooltiptime' :immediateChange='true' :columns="waveshowcolumns"
			@cancel='waveshow=false;canvasshow=true' @confirm='waveshowconfirm' keyName="name">
		</u-picker>
		<!-- 指标对比选择 -->
		<u-popup :show="indexshow" mode='center' @close="indexshow=false;canvasshow=true" round='10'>
			<view class="indexpopup">
				<view style="padding: 0 5%;">
					<view class="xuanzshebced">
						<u-form labelPosition="left">
							<u-form-item label="设备" prop="pointname"
								@click="indexcomparison.equipmentshow = true;hideKeyboard()" ref="item4">
								<u--input v-model="indexcomparison.equipmentname" disabled disabledColor="#f2f5f9"
									placeholder="请选择设备" border="none">
								</u--input>
								<u-icon slot="right" name="arrow-right"></u-icon>
							</u-form-item>
							<u-picker closeOnClickOverlay :immediateChange='true'
								@cancel="indexcomparison.equipmentshow = false" @confirm="equipmentconfirm"
								:show="indexcomparison.equipmentshow" :columns="indexcomparison.equipmentcolumns"
								keyName="name">
							</u-picker>
						</u-form>
					</view>
					<view class="xuanzshebced" style="margin-left: 10%;">
						<u-form labelPosition="left">
							<u-form-item label="测点" prop="pointname"
								@click="indexcomparison.pointshow = true;hideKeyboard()" ref="item4">
								<u--input v-model="indexcomparison.pointname" disabled disabledColor="#f2f5f9"
									placeholder="请选择测点" border="none">
								</u--input>
								<u-icon slot="right" name="arrow-right"></u-icon>
							</u-form-item>
							<u-picker closeOnClickOverlay :immediateChange='true'
								@cancel="indexcomparison.pointshow = false" @confirm="pointconfirm"
								:show="indexcomparison.pointshow" :columns="indexcomparison.pointcolumns"
								keyName="name">
							</u-picker>
						</u-form>
					</view>
				</view>
				<view class="addindexduibi">
					<u-button type="primary" shape='circle' text="添加对比指标" @click="adduser"></u-button>
				</view>
				<view style="overflow: hidden; height: 45%;">
					<scroll-view scroll-y="true" style="height: 100%;">
						<uni-list>
							<uni-list-item v-for="(item,index) in comparisolist" :key="index">
								<template v-slot:body>
									<text
										class="slot-box slot-text">{{item.equipmentname}}-{{item.pointname}}-{{item.indexname}}</text>
								</template>
								<template v-slot:footer>
									<u-tag text="删除" type="error" icon="trash" plain @click="deluser(item)"></u-tag>
								</template>
							</uni-list-item>
						</uni-list>
					</scroll-view>
				</view>
				<view style="margin: auto; width: 80%;">
					<u-button type="primary" text="确定" shape='circle' @click="drawcontrast"></u-button>
				</view>
			</view>
		</u-popup>
		<!-- 趋势图 -->
		<uni-ec-canvas v-show="canvasshow" class="uni-canvas" force-use-old-canvas="true" id="uni-ec-canvas"
			ref="canvas" canvas-id="uni-ec-canvas" :ec="ec">
		</uni-ec-canvas>
	</view>
</template>

<script>
	import uniEcCanvas from '@/components/uni-ec-canvas/uni-ec-canvas.vue'
	import * as echarts from '@/components/uni-ec-canvas/echarts'
	import {
		data
	} from '../../uni_modules/uview-ui/libs/mixin/mixin'
	let chart = null
	export default {
		components: {
			uniEcCanvas
		},
		data() {
			return {
				ec: {
					lazyLoad: true, //是否懒加载
				},
				option: {
					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
						"#ea7ccc"
					], //颜色
					toolbox: {
						show: true, //是否显示工具栏组件
						right: "3%", //右距离
						top: "35%", //上距离
						itemSize: 23, //工具大小
						orient: "vertical", //工具朝向
						itemGap: 20, //工具之间的间隔
						showTitle: false, //不显示标题
						feature: {
							brush: {
								type: ['lineX'] //开启横向选择功能
							},
							//自定义还原事件
							myTool: {
								icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',
								onclick: () => {
									this.restore();
								}
							},
							//自定义波形图事件
							myToolbo: {
								show: false,
								icon: 'M584.1 866.5c-6.9 0-12.9-4.7-14.6-11.4L438.9 320.9l-97.1 383.4c-1.6 6.4-7.2 11-13.8 11.3-6.6 0.3-12.6-3.7-14.8-9.9l-71.6-199.5H64c-8.3 0-15-6.7-15-15v-40c0-8.3 6.7-15 15-15h216.2c6.3 0 12 4 14.1 9.9l23.8 66.3 107.1-423c1.7-6.7 7.7-11.3 14.5-11.3h0.1c6.9 0 12.9 4.7 14.5 11.4l129.1 527.9 98.9-413.6c1.6-6.6 7.4-11.3 14.1-11.5 6.8-0.2 12.8 4.1 14.8 10.6L783 436.2h176.3c8.3 0 15 6.7 15 15v40c0 8.3-6.7 15-15 15H742.4c-6.6 0-12.4-4.3-14.3-10.6l-24.4-79.4-105 438.8c-1.6 6.7-7.6 11.5-14.6 11.5z m-145-622.7s0.1 0 0 0c7 0 12.9 4.7 14.6 11.4l130.2 532.4 103.3-431.9c1.6-6.6 7.4-11.3 14.1-11.5 6.8-0.2 12.8 4.1 14.8 10.6l37.3 121.4h190.9v-10H771.9c-6.6 0-12.4-4.3-14.3-10.6l-58.8-191.2-100.6 420.4c-1.6 6.7-7.6 11.5-14.6 11.5-6.9 0-12.9-4.7-14.6-11.4L439.6 155.3 335.2 567.5c-1.6 6.4-7.2 11-13.8 11.3-6.6 0.3-12.6-3.7-14.8-9.9l-36.8-102.7H79v10h173.1c6.3 0 12 4 14.1 9.9l58.5 163.2 99.8-394.2c1.8-6.7 7.8-11.3 14.6-11.3z',
								onclick: () => {
									this.gotowaveform();
								}
							},
						},
					},
					brush: { //刷选
						transformable: false,
						throttleDelay: 500,
						throttleType: 'debounce',
						xAxisIndex: 'all',
						outOfBrush: {
							colorAlpha: 0.1
						}
					},
					tooltip: {
						trigger: 'axis',
						axisPointer: {
							type: 'line' //指示器类型
						},
						formatter: ((params) => {
							this.tooltiptime = params[0].name;
							var text = params[0].name;
							for (let item of params) {
								text += '\n' + item.seriesName + ' : ' + item.value
							}
							return text
						})
					},
					legend: {
						show: true,
						top: "4%",
						data: []
					},
					xAxis: {
						type: 'category', //类目轴
						axisTick: {
							alignWithLabel: true //保证刻度线和标签对齐
						},
						data: [] //x轴的数据(时间)
					},
					dataZoom: {
						disabled: true,
						type: 'slider',
						zoomLock: false,
						start: 50,
						end: 100
					},
					grid: {
						top: '25%',
						bottom: '18%',
						left: '9%',
						right: '12%',
					},
					yAxis: [], //y轴
					series: [], //趋势图数据
				},
				showmore: false, //右侧选择栏
				canvasshow: true, //趋势图的显示和隐藏
				//时间选项
				columns: [{
					id: 86400000,
					name: '一天',
					show: false,
				}, {
					id: 604800000, //7天
					name: '一周',
					show: false,
				}, {
					id: 2592000000, //30天
					name: '一个月',
					show: false,
				}, {
					id: 7776000000, //90天
					name: '显示全部',
					show: false,
				}],
				id: '', //上个页面的传参
				pointTrend: '', //上个页面传递过来的参数
				scrollLoadingStatus: true, //趋势图翻页防抖处理
				// 是否保存还原数据
				savedata: true, //true表示保存,false表示不保存
				restoredata: '', //还原数据
				PhoneInfo: '', //手机信息
				nameti: '', //趋势图页面标题
				entrust: '', //是否是授权设备
				userinfo: '', //用户信息
				equipmentRealId: '', //设备id
				pointRealId: '', //测点id
				indexlist: [], //选中指标
				indexarr: [], //全部指标
				indexshow: false, //是否显示指标对比弹窗
				comparisolist: [], //对比指标列表(2-6)
				indexcomparison: {
					//设备
					equipmentid: '',
					equipmentname: '',
					equipmentshow: false,
					equipmentcolumns: [],
					// 测点
					pointid: '',
					pointname: '',
					pointshow: false,
					pointcolumns: [],
					//指标
					indexcolumns: [],
					indexunit: '', //当前指标的单位
					indexname: '', //当前指标的名称
				},
				timenumber: 2592000000, //当前时间的时间间隔毫秒数
				trendstarttime: '', //趋势图开始时间
				trendcurrenttime: '', //趋势图当前屏幕的开始时间
				trendendtime: '', //趋势图结束时间
				showStartTime: false,
				startTimeValue: '',
				showEndTime: false,
				endTimeValue: '',
				indexlistshow: false,
				waveshow: false,
				tooltiptime: '',
				waveshowcolumns: [
					[]
				],
				characteristic: {
					construction: [], //结构
					air: [], //空气
					vibration: [], //振动
					basics: [], //基础
				},
				waveformnumber: false,
				trendurl: 'api/users/{userRealId}/equipments/{equipmentRealId}/points/{pointRealId}/trend',
			}
		},
		onShow() {
			//每次进入页面时
			//更多弹窗,波形选择弹窗,指标对比弹窗全部关闭
			//趋势图显示
			this.showmore = false;
			this.canvasshow = true;
			this.indexshow = false;
			this.waveshow = false;
		},
		onLoad(parameter) {
			this.PhoneInfo = this.$utils.GetPhoneInfo();
			this.userinfo = uni.getStorageSync('userinfo');
			this.pointTrend = this.$store.state.pointTrend;
			this.id = parameter.id;
			this.equipmentRealId = this.pointTrend.equipmentRealId;
			this.pointRealId = this.pointTrend.pointRealId;
			this.entrust = this.pointTrend.entrust;
			this.nameti = this.pointTrend.nametitle;
			uni.setNavigationBarTitle({
				title: this.pointTrend.nametitle + '趋势图'
			})
			// 清空vuex中pointTrend中的数据
			this.$store.commit('alterpointTrend', '');
			//初始如果不通过点击指标进来的话,默认时间是一个月,获取两个月的数据
			this.trendstarttime = this.$utils.getTime(new Date().getTime() - 5184000000, 1);
			this.trendcurrenttime = this.$utils.getTime(new Date().getTime() - 2592000000, 1);
			this.trendendtime = this.$utils.getTime(new Date().getTime(), 1);
			//获取所有设备列表
			uni.request({
				url: getApp().globalData.serverAddress + this.$uri.Uri_getAllequipment
					.replace("{userRealId}",
						this.userinfo.userRealId),
				method: "GET",
				success: (res) => {
					if (res.statusCode !== 200) {
						this.$utils.showToast(this, '服务器错误,请联系技术支持人员!', 'error');
						return
					}
					this.indexcomparison.equipmentcolumns.push(res.data.data)
				}
			})
		},
		onReady() {
			this.getpointTarget()
		},
		methods: {
			//点击波形图
			gotowaveform() {
				//未选中时间点
				if (this.tooltiptime == '') {
					uni.showToast({
						icon: "none",
						title: "请先选择图上您要查询的时间点！",
						mask: true,
					})
				} else { //选中时间点
					uni.request({
						url: getApp().globalData.serverAddress + this.$uri.Uri_timeifwave
							.replace(
								'{userRealId}', this.userinfo.userRealId)
							.replace('{equipmentRealId}', this.equipmentRealId)
							.replace('{pointRealId}', this.pointRealId) + '?datetime=' + this.tooltiptime,
						method: "GET",
						success: (res) => {
							if (res.statusCode !== 200) {
								uni.showToast({
									icon: "none",
									title: "服务器错误,请联系技术支持人员!",
									mask: true,
								})
								return
							}
							if (res.data.code == 0) {
								//如果声音和振动波形都等于空
								if (res.data.data.waveDataRealId == '' && res.data.data.shockDataRealId ==
									'') {
									uni.showToast({
										icon: "none",
										title: "所选时间点没有波形数据！",
										mask: true,
									})
								} else if (res.data.data.waveDataRealId !== '' && res.data.data
									.shockDataRealId !== '') {
									this.waveshowcolumns[0] = [{
											id: res.data.data.waveDataRealId,
											name: '声音波形',
											number: 1,
										},
										{
											id: res.data.data.shockDataRealId,
											name: '振动波形',
											number: 3,
										}
									];
									this.canvasshow = false;
									this.waveshow = true;
								} else if (res.data.data.waveDataRealId !== '' && res.data.data
									.shockDataRealId == '') {
									this.waveshowcolumns[0] = [{
										id: res.data.data.waveDataRealId,
										name: '声音波形',
										number: 1,
									}];
									this.canvasshow = false;
									this.waveshow = true;
								} else {
									this.waveshowcolumns[0] = [{
										id: res.data.data.shockDataRealId,
										name: '振动波形',
										number: 3,
									}];
									this.canvasshow = false;
									this.waveshow = true;
								}
							} else {
								uni.showToast({
									icon: "none",
									title: res.data.msg,
									mask: true,
								})
							}
						},
						fail() {
							uni.showToast({
								icon: "none",
								title: "加载失败! ",
								mask: true,
							})
						}
					})
				}
			},
			//选择了那个波形
			waveshowconfirm(e) {
				var wavedata = {
					pointRealId: this.pointRealId,
					equipmentRealId: this.equipmentRealId,
					channelDataRealId: e.value[0].id,
					collectedTime: this.tooltiptime,
					name: this.pointTrend.nametitle,
					graphType: e.value[0].number,
					dataType: 1,
					starttime: this.$utils.getTime(Number(this.startTimeValue), 0),
					endtime: this.$utils.getTime(Number(this.endTimeValue), 0),
				}
				this.$store.commit('alterwaveform', wavedata);
				uni.navigateTo({
					url: '/pages/equipment/waveform'
				})
			},
			//是否只看波形数据
			clickwaveform() {
				if (this.waveformnumber) {
					this.waveformnumber = false;
					this.option.toolbox.feature.myToolbo.show = false;
					this.trendurl = 'api/users/{userRealId}/equipments/{equipmentRealId}/points/{pointRealId}/trend';
				} else {
					this.waveformnumber = true;
					this.option.toolbox.feature.myToolbo.show = true;
					this.trendurl =
						'api/users/{userRealId}/equipments/{equipmentRealId}/points/{pointRealId}/trendWithWaveFormData';
				}
			},
			//时间选择传值
			selectiontime(value) {
				if (value == 0) {
					this.canvasshow = false;
					this.showmore = false;
					this.showStartTime = true;
					this.$store.commit('altertimedata', this.startTimeValue);
				} else {
					this.canvasshow = false;
					this.showmore = false;
					this.showEndTime = true;
					this.$store.commit('altertimedata', this.endTimeValue);
				}
			},
			//获取测点指标
			getpointTarget() {
				uni.request({
					url: getApp().globalData.serverAddress + this.$uri.Uri_lookPointTarget
						.replace("{equipmentRealId}", this.equipmentRealId)
						.replace("{pointRealId}", this.pointRealId),
					method: "GET",
					success: (res) => {
						if (res.statusCode !== 200) {
							this.$utils.showToast(this, '服务器错误,请联系技术支持人员!', 'error');
							return
						}
						for (const data of res.data.data) {
							this.indexarr.push({
								id: data.pointFeatureRealId,
								code: data.code,
								unit: data.unit,
								name: data.name,
								show: false,
							})
						}
						if (this.id == 6) { //信号强度(RSRP)
							for (const i of this.indexarr) {
								if (i.code == 'RSRP') {
									i.show = true;
								}
							}
						} else if (this.id == 2) { //点击指标,只显示一个指标
							for (const i of this.indexarr) {
								if (i.id == this.pointTrend.indexid) {
									i.show = true
								}
							}
						} else if (this.id == 3) { //指标带时间
							for (const i of this.indexarr) {
								if (i.id == this.pointTrend.indexid) {
									i.show = true
								}
							}
							this.trendstarttime = this.$utils.getTime(new Date(this.pointTrend.time.replace(
									/-/g, '/'))
								.getTime() - 518400000, 1);
							this.trendcurrenttime = this.$utils.getTime(new Date(this.pointTrend.time.replace(
									/-/g, '/'))
								.getTime() - 259200000, 1);
							this.trendendtime = this.$utils.getTime(new Date(this.pointTrend.time.replace(
									/-/g, '/'))
								.getTime(), 1);
						} else if (this.id == 40) { //倾角带时间ZAN,YAN,XAN
							for (const i of this.indexarr) {
								if (i.code == 'XAN' || i.code == 'YAN' || i.code == 'ZAN') {
									i.show = true;
								}
							}
							this.trendstarttime = this.$utils.getTime(new Date(this.pointTrend.time.replace(
									/-/g, '/'))
								.getTime() - 518400000, 1);
							this.trendcurrenttime = this.$utils.getTime(new Date(this.pointTrend.time.replace(
									/-/g, '/'))
								.getTime() - 259200000, 1);
							this.trendendtime = this.$utils.getTime(new Date(this.pointTrend.time.replace(
									/-/g, '/'))
								.getTime(), 1);
						} else if (this.id == 41) { //倾角不带时间
							for (const i of this.indexarr) {
								if (i.code == 'XAN' || i.code == 'YAN' || i.code == 'ZAN') {
									i.show = true;
								}
							}
						} else if (this.id == 5) { //电量(POWER)
							for (const i of this.indexarr) {
								if (i.code == 'POWER') {
									i.show = true;
								}
							}
						} else if (this.id == 81) { //点击测点列表中下方的指标
							for (const i of this.indexarr) {
								if (i.code == this.pointTrend.indexcode) {
									i.show = true;
								}
							}
						} else { //都不是的情况下就是di等于一默认是垂直振动烈度(VSY)和冲击能量(ADB)
							for (const i of this.indexarr) {
								if (i.code == 'VSY' || i.code == 'ADB') {
									i.show = true;
								}
							}
						}
						for (const num of this.indexarr) {
							if (num.code == 'VSX' || num.code == 'VSY' ||
								num.code == 'VSZ') {
								this.characteristic.vibration.push(num);
							} else if (num.code == 'AUN' || num.code ==
								'ADB' || num.code ==
								'AFRE' || num.code == 'APEAK' || num.code == 'PDB' || num.code ==
								'AWDB') {
								this.characteristic.construction.push(num);
							} else if (num.code == 'AUNT' || num.code ==
								'ADBT' || num.code ==
								'PDBT' || num.code == 'AWDBT' || num.code == 'AFRET' || num.code == 'APEAKT'
							) {
								this.characteristic.air.push(num);
							} else {
								this.characteristic.basics.push(num);
							}
							if (num.show) {
								this.indexlist.push(num)
							}
						}
						if (new Date().getTime() - 7776000000 > new Date(this.trendstarttime.replace(/-/g,
								'/')).getTime()) {
							uni.showModal({
								content: '您即将查询三个月之前的数据,可能需要花费较长的时间,是否继续?',
								cancelText: '否',
								confirmText: '是',
								success: function(res) {
									//点击是的话继续查询
									if (res.confirm) {
										var that = this;
										that.getChartsData()
									} else { //点击否的话直接跳转回上一级页面
										uni.navigateBack({
											delta: 1
										});
									}
								}.bind(this)
							});
						} else { //如果没有超过三个月的话,直接请求数据
							this.getChartsData()
						}
					}
				})
			},
			//选择指标
			alterindex(value) {
				for (var item of this.indexarr) {
					if (item.id === value.id) {
						if (!item.show) {
							if (this.indexlist.length >= 4) {
								uni.showToast({
									icon: "none",
									title: "最多选择四个指标! ",
									mask: true,
								})
							} else {
								item.show = true;
								this.indexlist.push(item)
							}
						} else {
							if (this.indexlist.length <= 1) {
								uni.showToast({
									icon: "none",
									title: "最少选择一个指标! ",
									mask: true,
								})
							} else {
								item.show = false;
								for (var i = 0; i < this.indexlist.length; i++) {
									if (this.indexlist[i].id == value.id) {
										this.indexlist.splice(i, 1)
									}
								}
							}
						}
					}
				}
			},
			//时间变化
			altertime(value) {
				for (var item of this.columns) {
					if (item.id === value.id) {
						if (item.show) {
							item.show = false;
						} else {
							item.show = true;
							this.endTimeValue = new Date().getTime();
							this.startTimeValue = this.endTimeValue - value.id;
						}
					} else {
						item.show = false;
					}
				}
			},
			//点击其他地方(关闭更多弹窗,绘制趋势图)
			moreconfirm() {
				//隐藏更多弹窗
				this.showmore = false;
				//保存还原数据
				this.savedata = true;
				//按照时间选择器进行时间处理
				this.timenumber = this.endTimeValue - this.startTimeValue;
				//判断时间如果是三个月的话,那就吧start改成和current一样的
				if (this.timenumber == 7776000000) {
					this.trendstarttime = this.$utils.getTime(Number(this.startTimeValue), 1);
				} else { //如果不是的话那就向前走一倍的时间
					this.trendstarttime = this.$utils.getTime(Number(this.startTimeValue) -
						this.timenumber, 1);
				}
				this.trendcurrenttime = this.$utils.getTime(Number(this.startTimeValue), 1);
				this.trendendtime = this.$utils.getTime(Number(this.endTimeValue), 1);
				this.getChartsData()
			},
			//开始时间确定
			startconfirm(e) {
				this.startTimeValue = e.value;
				this.showStartTime = false;
				this.canvasshow = true;
				this.showmore = true;
				for (var item of this.columns) {
					item.show = false;
				}
				var millisecond = this.endTimeValue - this.startTimeValue;
				if (millisecond <= 0) {
					uni.showToast({
						icon: "none",
						title: "时间范围选择有误,请重新选择!",
						mask: true,
					})
					return
				}
				if (millisecond > 2592000000) {
					uni.showToast({
						icon: "none",
						title: "选择的时间跨度最多不能超过一个月,请重新选择!",
						mask: true,
					})
					return
				}
			},
			// 结束时间确定
			endconfirm(e) {
				this.endTimeValue = e.value;
				this.showEndTime = false;
				this.canvasshow = true;
				this.showmore = true;
				for (var item of this.columns) {
					item.show = false;
				}
				var millisecond = this.endTimeValue - this.startTimeValue;
				if (millisecond <= 0) {
					uni.showToast({
						icon: "none",
						title: "时间范围选择有误,请重新选择!",
						mask: true,
					})
					return
				}
				if (millisecond > 2592000000) {
					uni.showToast({
						icon: "none",
						title: "选择的时间跨度最多不能超过一个月,请重新选择!",
						mask: true,
					})
					return
				}
			},
			//点击指标对比
			clickcompare() {
				this.showmore = false; //隐藏更多选择栏
				this.canvasshow = false; //隐藏趋势图
				this.indexshow = true; //显示指标选择弹窗
				// 在添加之前需要先清空列表以及清空选择框
				this.comparisolist = [];
				this.indexcomparison.equipmentname = '';
				this.indexcomparison.equipmentid = '';
				this.indexcomparison.pointname = "";
				this.indexcomparison.pointid = "";
				this.indexcomparison.pointcolumns = [];
				//不管是授权还是创建都将名称和单位赋值
				this.indexunit = this.indexlist[0].unit;
				this.indexname = this.indexlist[0].name;
				//判断是创建还是授权.创建加入,授权不加
				if (this.entrust == 0) { //0表示创建  1表示授权
					var equipname = '';
					var pointname = '';
					for (let item of this.indexcomparison.equipmentcolumns[0]) {
						if (item.equipmentRealId == this.equipmentRealId) {
							equipname = item.name;
							for (let items of item.points) {
								if (items.pointRealId == this.pointRealId) {
									pointname = items.name;
								}
							}
						}
					}
					//然后将当前的指标先加到列表中
					this.comparisolist.push({
						equipmentid: this.equipmentRealId,
						equipmentname: equipname,
						pointid: this.pointRealId,
						pointname: pointname,
						indexid: this.indexlist[0].id,
						indexname: this.indexname,
						indexunit: this.indexunit,
					})
				}
			},
			//选择设备
			equipmentconfirm(e) {
				this.indexcomparison.equipmentname = e.value[0].name;
				this.indexcomparison.equipmentid = e.value[0].equipmentRealId;
				//选择或者修改设备以后测点和指标的输入框和列表都需要清空
				this.indexcomparison.pointname = "";
				this.indexcomparison.pointid = "";
				this.indexcomparison.pointcolumns = [];
				this.indexcomparison.pointshow = false;
				this.indexcomparison.indexcolumns = [];
				//循环遍历获取设备下的测点
				for (let item of this.indexcomparison.equipmentcolumns[0]) {
					if (item.equipmentRealId == this.indexcomparison.equipmentid) {
						this.indexcomparison.pointcolumns.push(item.points)
					}
				}
				this.indexcomparison.equipmentshow = false
			},
			//选择测点
			pointconfirm(e) {
				this.indexcomparison.pointname = e.value[0].name
				this.indexcomparison.pointid = e.value[0].pointRealId
				this.indexcomparison.pointshow = false
				this.indexcomparison.indexcolumns = [];
				//选择完测点以后获取设备下的指标
				for (let items of this.indexcomparison.pointcolumns[0]) {
					if (items.pointRealId == this.indexcomparison.pointid) {
						this.indexcomparison.indexcolumns.push(items.pointFeatures)
					}
				}
			},
			//添加对比指标
			adduser() {
				if (this.indexcomparison.equipmentid == '') {
					uni.showToast({
						icon: "none",
						title: "请选择设备！",
						mask: true,
					})
					return;
				}
				if (this.indexcomparison.pointid == '') {
					uni.showToast({
						icon: "none",
						title: "请选择测点！",
						mask: true,
					})
					return;
				}
				if (this.comparisolist.length >= 6) {
					uni.showToast({
						icon: "none",
						title: "最多只能选择六个指标进行对比！",
						mask: true,
					})
					return;
				}
				for (let i of this.comparisolist) {
					if (i.equipmentid == this.indexcomparison.equipmentid && i.pointid == this.indexcomparison.pointid) {
						uni.showToast({
							icon: "none",
							title: "该指标已存在,请重新选择！",
							mask: true,
						})
						return;
					}
				}
				var pointindexid = '';
				for (let ite of this.indexcomparison.indexcolumns[0]) {
					if (ite.unit == this.indexunit && ite.name == this.indexname) {
						pointindexid = ite.pointFeatureRealId
					}
				}
				this.comparisolist.push({
					equipmentid: this.indexcomparison.equipmentid,
					equipmentname: this.indexcomparison.equipmentname,
					pointid: this.indexcomparison.pointid,
					pointname: this.indexcomparison.pointname,
					indexid: pointindexid,
					indexname: this.indexlist[0].name,
					indexunit: this.indexlist[0].unit,
				})
				//添加完成指标以后清空设备已经测点的选择框
				this.indexcomparison.equipmentname = '';
				this.indexcomparison.equipmentid = '';
				this.indexcomparison.pointname = "";
				this.indexcomparison.pointid = "";
				this.indexcomparison.pointcolumns = [];
			},
			// 删除指标
			deluser(value) {
				for (var i = 0; i < this.comparisolist.length; i++) {
					if (this.comparisolist[i].equipmentid == value.equipmentid && this.comparisolist[i].pointid == value
						.pointid) {
						this.comparisolist.splice(i, 1)
						break
					}
				}
			},
			//隐藏软键盘
			hideKeyboard() {
				uni.hideKeyboard()
			},
			//跳转指标对比趋势图
			drawcontrast() {
				var arrlist = []
				if (this.comparisolist.length >= 2) {
					for (let item of this.comparisolist) {
						arrlist.push({
							startTime: this.$utils.getTime(new Date().getTime() - 518400000, 0),
							endTime: this.$utils.getTime(new Date().getTime(), 0),
							currentTime: this.$utils.getTime(new Date().getTime() - 259200000, 0),
							EquipmentName: item.equipmentname,
							PointName: item.pointname,
							PointFeatureRealId: item.indexid,
							PointFeatureName: item.indexname,
							PointFeatureUnit: item.indexunit,
						})
					}
					this.$store.commit('alterContrastTrendChart', arrlist);
					uni.navigateTo({
						url: '/pages/equipment/ContrastTrendChart'
					})
				} else {
					uni.showToast({
						icon: "none",
						title: "最少选择两个不同设备或测点的指标进行对比！",
						mask: true,
					})
				}
			},
			//修改阈值
			gotofeaturelist() {
				let parameterinfo = {
					pointRealId: this.pointRealId,
					equipmentRealId: this.equipmentRealId,
					name: this.nameti,
					targetid: this.indexlist[0].id,
					entrust: this.entrust,
				}
				let parameterinfodata = JSON.stringify(parameterinfo);
				uni.redirectTo({
					url: `/pages/equipment/changeThreshold?content=${encodeURIComponent(parameterinfodata)}`
				})
			},
			//绘制趋势图
			initChart(canvas, width, height, canvasDpr) {
				//显示趋势图
				this.canvasshow = true;
				chart = echarts.init(canvas, null, {
					width: width,
					height: height,
					devicePixelRatio: canvasDpr
				})
				canvas.setChart(chart)
				chart.setOption(this.option)
				//保留原始数据
				if (this.savedata) {
					this.restoredata = JSON.parse(JSON.stringify(this.option));
				}
				//获取初始时间
				var optinfo = chart.getOption();
				this.startTimeValue = new Date(this.option.xAxis.data[optinfo.dataZoom[0].startValue].replace(/-/g, '/'))
					.getTime();
				this.endTimeValue = new Date(this.option.xAxis.data[optinfo.dataZoom[0].endValue].replace(/-/g, '/'))
					.getTime();
				//“框选添加完毕”事件
				chart.on('brushEnd', (param) => {
					this.startTimeValue = new Date(this.option.xAxis.data[param.areas[0].coordRange[0]].replace(
						/-/g, '/')).getTime();
					this.endTimeValue = new Date(this.option.xAxis.data[param.areas[0].coordRange[1]].replace(/-/g,
						'/')).getTime();
					this.timenumber = this.endTimeValue - this.startTimeValue;
					this.trendstarttime = this.$utils.getTime(this.startTimeValue - this.timenumber, 1);
					this.trendcurrenttime = this.$utils.getTime(this.startTimeValue, 1);
					this.trendendtime = this.$utils.getTime(this.endTimeValue, 1);
					if (new Date().getTime() - 7776000000 > this.startTimeValue - this.timenumber) {
						uni.showModal({
							content: '您即将查询三个月之前的数据,可能需要花费较长的时间,是否继续?',
							cancelText: '否',
							confirmText: '是',
							success: function(res) {
								if (res.confirm) {
									var that = this;
									for (let item of that.columns) {
										item.show = false;
									}
									//不保存还原数据
									that.savedata = false;
									that.getChartsData();
								}
							}.bind(this)
						});
					} else {
						for (let item of this.columns) {
							item.show = false;
						}
						//不保存还原数据
						this.savedata = false;
						this.getChartsData();
					}
				})
				//监听拖动趋势图事件
				chart.on('datazoom', (param) => {
					//获取当前屏幕的显示时间
					var opti = chart.getOption()
					this.startTimeValue = new Date(this.option.xAxis.data[opti.dataZoom[0].startValue].replace(
						/-/g, '/')).getTime();
					this.endTimeValue = new Date(this.option.xAxis.data[opti.dataZoom[0].endValue].replace(/-/g,
						'/')).getTime();
					//翻页
					if (opti.dataZoom[0].start == 0) {
						//防抖
						if (this.scrollLoadingStatus == false) {
							return;
						} else {
							this.scrollLoadingStatus = false;
							var timenewdata = 0;
							if (this.timenumber == 86400000) {
								timenewdata = new Date(this.trendstarttime.replace(/-/g, '/')).getTime() -
									this.timenumber * 3;
							} else {
								timenewdata = new Date(this.trendstarttime.replace(/-/g, '/')).getTime() -
									this.timenumber * 2;
							}
							//判断时间是否超过三个月
							if (new Date().getTime() - 7776000000 > timenewdata) {
								uni.showModal({
									content: '您即将查询三个月之前的数据,可能需要花费较长的时间,是否继续?',
									cancelText: '否',
									confirmText: '是',
									success: function(res) {
										if (res.confirm) {
											var that = this;
											that.getNewData()
										}
									}.bind(this)
								});
							} else {
								this.getNewData()
							}
						}
					}
				})
				return chart
			},
			//获取趋势图数据
			getChartsData() {
				this.scrollLoadingStatus = true;
				this.option.yAxis = []; //清除y轴
				this.option.xAxis.data = []; //清除时间
				this.option.series = []; ///清除数据
				let trenddate = new Object();
				trenddate.startTime = this.trendstarttime + '00:00:00';
				trenddate.endTime = this.trendendtime + '23:59:59';
				trenddate.currentTime = this.trendcurrenttime + '00:00:00';
				trenddate.pointFeatures = this.indexlist;
				trenddate.page = 1;
				trenddate.limit = 1000;
				uni.showLoading({
					title: "加载中...",
					mask: true,
				});
				setTimeout(() => {
					uni.request({
						url: getApp().globalData.serverAddress + this.trendurl.replace(
								"{userRealId}", this.userinfo.userRealId)
							.replace("{equipmentRealId}", this.equipmentRealId)
							.replace("{pointRealId}", this.pointRealId),
						data: JSON.stringify(trenddate),
						dataType: "json",
						method: "POST",
						success: (res) => {
							if (res.statusCode !== 200) {
								uni.showToast({
									icon: "none",
									title: "服务器错误,请联系技术支持人员! ",
									mask: true,
								})
								return
							}
							const response = res.data;
							if (response.code == 0) {
								if (response.count == 0) {
									uni.showToast({
										icon: "none",
										title: "所选时间段暂无数据,请重新选择! ",
										mask: true,
									})
								} else {
									var serial = 0;
									var position = 'left';
									var offset = 0;
									var namegap = 15;
									for (var item of response.data) {
										this.option.legend.data.push(item.pointFeatureName);
										//单位处理
										if (item.pointFeatureUnit !== '') {
											item.pointFeatureUnit = item.pointFeatureUnit == 'ma' ?
												'%' : '(' + item.pointFeatureUnit + ')';
										}
										var minvalue = 0;
										if (item.pointFeatureCode == 'ADB' || item.pointFeatureCode ==
											'APEAK') {
											minvalue = 45;
										} else if (item.pointFeatureCode == 'PDB') {
											minvalue = 14;
										}
										//y轴
										this.option.yAxis.push({
											type: 'value',
											name: item.pointFeatureName + item
												.pointFeatureUnit,
											offset: offset,
											position: position,
											nameGap: namegap,
											max: (Math.max(item.highRisk, item.max) * 1.1)
												.toFixed(2),
											min: minvalue,
											splitLine: {
												show: false
											},
										})
										//改变y轴的位置
										if (position == 'left') {
											position = 'right';
										} else {
											position = 'left';
											offset += 45;
											namegap = 30;;
										}
										//改变组件距离左右的距离
										if (this.indexlist.length > 2) {
											this.option.grid.left = '13%';
											this.option.grid.right = '16%';
										} else {
											this.option.grid.left = '9%';
											this.option.grid.right = '12%';
										}
										// 如果时间长度等于0表是第一次循环
										if (this.option.xAxis.data.length == 0) {
											for (var items of item.eigenDatas) {
												this.option.xAxis.data.push(items.dateTime)
											}
										}
										var arr = []
										for (var items of item.eigenDatas) {
											arr.push(items.value)
										}
										if (response.data.length == 1) {
											this.option.series.push({
												name: item.pointFeatureName,
												type: 'line',
												yAxisIndex: serial,
												smooth: true,
												emphasis: {
													focus: 'series'
												},
												data: arr,
												color: this.option.color[serial],
												markPoint: {
													data: [{ //最大值
															type: 'max',
															name: 'Max'
														},
														{ //最小值
															type: 'min',
															name: 'Min'
														}
													]
												},
												markLine: {
													silent: true,
													data: [{
															yAxis: item.unusual,
															lineStyle: {
																color: '#ffaa00'
															},
														},
														{
															yAxis: item.warning,
															lineStyle: {
																color: '#fe6601'
															},
														},
														{
															yAxis: item.highRisk,
															lineStyle: {
																color: '#e43d33'
															},
														},
													]
												}
											})
										} else {
											this.option.series.push({
												name: item.pointFeatureName,
												type: 'line',
												yAxisIndex: serial,
												smooth: true,
												emphasis: {
													focus: 'series'
												},
												data: arr,
												color: this.option.color[serial],
											})
										}
										serial += 1
									}
									uni.hideLoading();
									//定位显示区域
									this.option.dataZoom.end = 100;
									this.option.dataZoom.start = 100 - Math.round(response.count /
										response.data[
											0].eigenDatas.length * 100);
									this.$refs.canvas.init(this.initChart)
								}
							} else {
								uni.showToast({
									icon: "none",
									title: res.data.msg,
									mask: true,
								})
							}
						},
						fail(res) {
							uni.showToast({
								icon: "none",
								title: "加载失败！",
								mask: true,
							})
						}
					})
				}, 1000);
			},
			//翻页
			getNewData() {
				this.trendendtime = this.trendstarttime;
				this.trendcurrenttime = this.$utils.getTime(new Date(this.trendstarttime.replace(/-/g, '/')).getTime() -
					this.timenumber, 1);
				if (this.timenumber == 86400000) {
					this.trendstarttime = this.$utils.getTime(new Date(this.trendstarttime.replace(/-/g, '/')).getTime() -
						this.timenumber * 3, 1);
				} else {
					this.trendstarttime = this.$utils.getTime(new Date(this.trendstarttime.replace(/-/g, '/')).getTime() -
						this.timenumber * 2, 1);
				}
				let pagingdata = new Object();
				pagingdata.startTime = this.trendstarttime + '00:00:00';
				pagingdata.endTime = this.trendendtime + '23:59:59';
				pagingdata.currentTime = this.trendcurrenttime + '00:00:00';
				pagingdata.pointFeatures = this.indexlist;
				pagingdata.page = this.pageindex;
				pagingdata.limit = this.limit;
				uni.showLoading({
					title: "加载中...",
					mask: true,
				});
				setTimeout(() => {
					let categories = [];
					uni.request({
						url: getApp().globalData.serverAddress + this.trendurl
							.replace(
								"{userRealId}", this.userinfo.userRealId)
							.replace("{equipmentRealId}", this.equipmentRealId)
							.replace("{pointRealId}", this.pointRealId),
						data: JSON.stringify(pagingdata),
						dataType: "json",
						method: "POST",
						success: (res) => {
							if (res.statusCode !== 200) {
								uni.showToast({
									icon: "none",
									title: "服务器错误,请联系技术支持人员! ",
									mask: true,
								})
								return
							}
							const response = res.data;
							if (response.code == 0) {
								if (response.count == 0) {
									uni.showToast({
										icon: "none",
										title: "没有更多数据了! ",
										mask: true,
									})
								} else {
									var serial = 0
									for (var item of response.data) { //循环遍历数据
										var max = Math.max(item.highRisk, item.max)
										this.option.yAxis[serial].max = (Math.max(max, this.option
											.yAxis[serial].max) * 1.1).toFixed(2);
										//当ressdata中时间数组长度为0,赋值时间,为0表示是第一次循环
										if (categories.length == 0) {
											for (var items of item.eigenDatas) {
												categories.push(items
													.dateTime)
											}
											//拿到翻页以后的数据用concat方法进行数组拼接
											this.option.xAxis.data = categories.concat(this.option
												.xAxis.data);
										}
										var arr = []
										for (var items of item.eigenDatas) {
											arr.push(items.value)
										}
										this.option.series[serial].data = arr
											.concat(this.option.series[serial].data);
										serial++
									}
									uni.hideLoading();
									//定位显示区域
									this.option.dataZoom.end = Math.round(categories.length / this
										.option.xAxis
										.data.length * 100);
									this.option.dataZoom.start = Math.round(this.option.dataZoom.end /
										2);
									//绘制趋势图
									this.$refs.canvas.init(this.initChart)
									//防抖处理
									this.scrollLoadingStatus = true;
								}
							} else {
								uni.showToast({
									icon: "none",
									title: res.data.msg,
									mask: true,
								})
							}
						},
						fail() {
							uni.showToast({
								icon: "none",
								title: "加载失败！",
								mask: true,
							})
						}
					})
				}, 1000);
			},
			//还原
			restore() {
				this.option.xAxis = JSON.parse(JSON.stringify(this.restoredata.xAxis));
				this.option.yAxis = JSON.parse(JSON.stringify(this.restoredata.yAxis));
				this.option.series = JSON.parse(JSON.stringify(this.restoredata.series));
				this.option.dataZoom = JSON.parse(JSON.stringify(this.restoredata.dataZoom));
				this.scrollLoadingStatus = true;
				this.$refs.canvas.init(this.initChart)
			}
		}
	}
</script>
<style>
	.uni-list--border-top {
		height: 0px !important;
	}

	.uni-list--border-bottom {
		height: 0px !important;
	}

	.uni-list {
		background-color: #f2f5f9 !important;
	}

	.uni-list-item__container {
		padding: 5rpx 20rpx !important;
	}
</style>
<style scoped lang="scss">
	//趋势图
	.uni-canvas {
		width: 100%;
		height: 100%;
	}

	//更多
	.more {
		display: inline-block;
		right: 8%;
		position: fixed;
		top: 3%;
		z-index: 1;
	}

	//遮罩
	.shabe {
		width: 100%;
		height: 100%;
		position: fixed;
		z-index: 2;
	}

	cover-view {
		white-space: pre-wrap;
	}

	//更多弹窗
	.shabedata {
		width: 45%;
		height: 100%;
		margin-left: 55%;
		background-color: #f2f5f9;
	}

	//标题
	.title {
		font-size: 16px;
		width: 100%;
		text-align: center;
		color: #303133;
		font-weight: bold;
		margin: 2% 0%;
	}

	//自定义时间
	.zdytime {
		width: 95%;
		margin: 2% auto 0%;
	}

	//至
	.hgtime {
		width: 10%;
		display: inline-block;
		height: 30px;
		line-height: 30px;
		font-size: 15px;
		text-align: center;
		color: #303133;
	}

	//开始和结束时间选择器
	.zdytime .time {
		width: 40%;
		display: inline-block;
		height: 25px;
		line-height: 25px;
		font-size: 15px;
		text-align: center;
		color: #303133;
		border: 1px solid #c4c6c9;
		border-radius: 15px;
	}

	//快捷时间
	.kjtime {
		width: 95%;
		margin: auto;
	}

	//快捷时间选项
	.timeview {
		display: inline-block;
		width: 22%;
		border-radius: 30px;
		text-align: center;
		font-size: 14px;
		margin-left: 2%;
		height: 25px;
		line-height: 25px;
	}

	//指标
	.zhibiao {
		width: 95%;
		margin: auto;
	}

	//是否选中和禁用
	.xz {
		color: #3c9cff;
		border: 1px solid #3c9cff;
	}

	.wxz {
		color: #303133;
		border: 1px solid #c4c6c9;
	}

	//指标列表
	.zhibiaoliebiao {
		position: absolute;
		top: 0;
		height: 100%;
		left: 5%;
		background-color: #ffffff;
		width: 46%;
		padding: 0% 2%;
	}

	// 指标列表选项
	.indexlistview {
		flex-grow: 1;
		width: 30%;
		border-radius: 30px;
		text-align: center;
		font-size: 12px;
		height: 25px;
		line-height: 25px;
		margin: 0.5% 1%;
	}

	//选中的指标
	.indexyxz {
		display: inline-block;
		width: 40%;
		border: 1px solid #3c9cff;
		border-radius: 30px;
		text-align: center;
		font-size: 14px;
		margin-left: 7%;
		height: 25px;
		line-height: 25px;
		color: #3c9cff;
	}

	//波形图
	.waveform {
		width: 40%;
		border: 1px solid #303332;
		border-radius: 30px;
		text-align: center;
		font-size: 14px;
		margin: 4% auto 2%;
		height: 25px;
		line-height: 25px;
		color: #303332;
	}

	.wavef {
		width: 40%;
		border: 1px solid #3c9cff;
		border-radius: 30px;
		text-align: center;
		font-size: 14px;
		margin: 4% auto 2%;
		height: 25px;
		line-height: 25px;
		color: #3c9cff;
	}


	//指标对比和修改阈值
	.alterduibi {
		width: 95%;
		margin: auto;
	}

	//修改阈值,指标对比
	.viewcover {
		display: inline-block;
		width: 40%;
		border: 1px solid #c4c6c9;
		border-radius: 30px;
		text-align: center;
		font-size: 14px;
		margin-left: 7%;
		height: 25px;
		line-height: 25px;
		color: #303133;
	}

	//指标对比
	.indexpopup {
		border-radius: 10px;
		padding: 15rpx 5% 35rpx;
		width: 600rpx;
		height: 280rpx;
		background-color: #f2f5f9;
	}

	//列表
	.slot-box {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		align-items: center;
	}

	//列表文本
	.slot-text {
		flex: 1;
		font-size: 15px;
		color: #3c9cff;
	}

	//添加指标对比
	.addindexduibi {
		width: 80%;
		margin: 1% 10%;
	}

	//选择设备和测点
	.xuanzshebced {
		display: inline-block;
		width: 45%;
	}

	//分类标题
	.biaoti {
		width: 100%;
		padding: 1% 0%;
		text-align: center;
		font-size: 15px;
		font-weight: bold;
	}

	//分类指标
	.xiaindexlist {
		display: flex;
		flex-wrap: wrap;
	}
</style>